<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$setting=$this->plugin_setting('setting');
$return['adv']=$setting['hdps'];
if($_RQ['op']=='list'){
	$postdata=get_postdata();
	$pindex = max(1, intval($postdata['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'ishome'=>1,'status'=>1);
	if($postdata['key']){
		$params['title like']='%'.trim($postdata['key']).'%';
	}
	if($_RQ['groupid']){
		$params['group_id']=$_RQ['groupid'];
	
	}
	
   // $fields=array('id','title','image','','url','paixu','readnum','ishome','ishot');
    $orderby='paixu desc';
	$total='';
	$return['list']=pdo_getslice('jy_cmslive_list',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	
	foreach($return['list'] as &$v){
		if($v['time'] < TIMESTAMP){
			$v['living']=1;
		}else{
			$v['living']=0;
		}
		$v['time']=$v['time']?date('Y-m-d H:i:s',$v['time']):date('Y-m-d H:i:s',TIMESTAMP);
	}
	$return['groups']=pdo_getslice('jy_cmslive_group',array('uniacid'=>$_SESSION['uniacid'],'status'=>1));
	$return['setting'] = $setting;
	exi($return);
}

?>